#include "topic_list.h"

int TopicList::serialize(int messageType, char * message)
{
	return 0;
}

int TopicList::deseralize(int messageType, const std::string & message)
{
	Document doc;
	doc.Parse(message.c_str());
	assert(doc.IsObject());

	assert(doc.HasMember("topics"));
	assert(doc["topics"].IsArray());
	rapidjson::Value& topics = doc["topics"];
	for (int i = 0; i < topics.Size(); i++) 
	{
		topics_.push_back(topics[i].GetString());
	}

	return 0;
}
